package com.example.car

import android.os.Bundle
import android.view.Window
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.example.car.bean.NewsListBean
import com.example.car.databinding.ActivityNewInfoBinding

class NewInfoActivity : AppCompatActivity() {
    lateinit var binding: ActivityNewInfoBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityNewInfoBinding.inflate(layoutInflater)
        setContentView(binding.root)

        val window: Window = this@NewInfoActivity.window
        window.statusBarColor = ContextCompat.getColor(this@NewInfoActivity, R.color.black)

        val data: NewsListBean.Result.Data? = getIntent().getParcelableExtra("data")
        binding.apply {
            toolbar.title = data?.title
            webView.loadUrl(data?.url!!)

            toolbar.setOnClickListener { finish() }
        }

    }
}